// import request from '@/utils/request'
import request from '../utils/request'

/**
 * 登录
 * @param {*} data {mobile, code}
 */
export function login (data) {
  // 返回请求的Promise对象
  return request.post('authorizations', data)
}
/**
 * 关注用户
 * @param {*} target 用户ID
 */
export function follow (target) {
  return request.post('user/followings', { target })
}

/**
 * 取关用户
 * @param {*} target 用户ID
 */
export function unFollow (target) {
  return request.delete(`user/followings/${target}`)
}

/**
 * 获取用户个人信息
 */
export function getUserInfo () {
  return request.get('user')
}

/**
 * 获取个人中心用户编辑资料信息
 */
export function getUserProfile () {
  return request.get('user/profile')
}
